<?php
class PNOrderItemArray extends PNObjectArray {
  function PNOrderItemArray($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'ishopstore_order_item';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_objJoin[]     = array ( 'join_table'  =>  'ishopstore_item',
                        'join_field'              =>  array('id','title','detail','price','sale_price','firstfilename','firstthumbname'),
                        'object_field_name'       =>  array('id','title','detail','price','sale_price','firstfilename','firstthumbname'),
                        'compare_field_table'     =>  'item_id',
                        'compare_field_join'      =>  'id');
                        
    $this->_objJoin[]     = array ( 'join_table'  =>  'ishopstore_order',
                        'join_field'              =>  array('id'),
                        'object_field_name'       =>  array('id'),
                        'compare_field_table'     =>  'order_id',
                        'compare_field_join'      =>  'id');


    $this->_init($init, $where);
  }
  
  function genFilter()
  {
    $id = FormUtil::getPassedValue ('id', false);
    $where = '';
    if ($id){
      $where = "WHERE orditm_order_id = '$id'";
    }
    return $where;
  }
}
